<?PHP
include("settings.php");
include("connect.php");

$destroyeditem = intval($_GET['i']);

if (!empty($destroyeditem)) {
			$result4 = $db->query('SELECT * FROM invtypes WHERE 1 AND typeID LIKE "'.$destroyeditem.'"');
			while ($row4 = mysql_fetch_object($result4)) {
			$destroyeditemimageID = $row4->graphicID;
			$groupID = $row4->groupID;
			$destroyeditemimagemaybe = $row4->typeID;
			}
		$query8 = ('SELECT categoryID FROM invgroups WHERE 1 AND groupID LIKE "'.$groupID.'"');
		$result8 = mysql_query($query8) or die("Query : <br /><br />$query8<br /><br />failed : " . mysql_error());
		while ($row8 = mysql_fetch_object($result8)) {
			$categoryID = $row8->categoryID;
			}
		if (($categoryID == 6) OR ($categoryID == 18)) {
				$destroyeditemimage = $destroyeditemimagemaybe;
		} else {
			$query4 = ('SELECT icon FROM evegraphics WHERE 1 AND graphicID LIKE "'.$destroyeditemimageID.'"');
			$result4 = mysql_query($query4) or die("Query : <br /><br />$query4<br /><br />failed : " . mysql_error());
			while ($row4 = mysql_fetch_object($result4)) {
			$destroyeditemimage = 'icon'.$row4->icon.'';
			}
		  }
		  
header('Content-Type: image/png');
readfile($settings['workingdir'] . '/images/64_64/'.$destroyeditemimage.'.png' );
}
?>